package com.coding.service.impl;


import com.coding.mapper.FollowMapper;
import com.coding.service.FollowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class FollowServiceImpl implements FollowService {
    @Autowired
    private FollowMapper followMapper;

    public void followUser(Long followerId, Long followeeId) {
        followMapper.insert(followerId, followeeId);
    }

    public boolean isFollowing(Long followerId, Long followeeId) {
        Integer following = followMapper.isFollowing(followerId, followeeId);
        return following != null && following == 1;
    }
}

